package com.ujson.uaa.controller;

import com.ujson.base.common.dto.Res;
import com.ujson.uaa.service.UserService;
import com.ujson.uaa.types.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <h3>uaa-provider</h3>
 * <p>用户登录</p>
 *
 * @author JerryLiu  a1031757312@gmail.com
 * @version 1.0
 * @date 2021-11-20 13:10
 */
@Api("用户登录服务")
@RestController
public class LoginController {

    @Autowired
    private UserService userService;

    @ApiOperation(value = "登录")
    @RequestMapping("/login")
    public Object login() {


        return Res.success();
    }

    @ApiOperation(value = "登出")
    @RequestMapping("/logout")
    public Object logout() {


        return Res.success();
    }

    @ApiOperation(value = "注册")
    @PostMapping("/register")
    public Object register(@RequestBody User user) {
        return userService.register(user);
    }
}
